﻿@model MvcGraduate.Models.Images

<head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="~/Content/CSS/DetailsTableCss.css" />
    @* UEditor start *@
    <script type="text/javascript" charset="utf-8" src="~/Content/UEditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="~/Content/UEditor/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="~/Content/UEditor/ueditor.all.js"> </script>
    <link href="~/Content/UEditor/themes/iframe.css" rel="stylesheet" />
    <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
    <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
    <script type="text/javascript" charset="utf-8" src="~/Content/UEditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
    <div id="#details_table_div">
        <table border="0" width="80%" cellspacing="0">
            <tr>
                <td>
                    <img src="~/Images/notify_new.gif" />
                    <span class="big3">照片管理</span>
                </td>
            </tr>
        </table>
        @using (Html.BeginForm("SaveChange", "Interaction", FormMethod.Post))
        {
            @Html.HiddenFor(model => model.ID)
            @Html.Hidden("Sign","Picture")
            <table width="80%" align="center" class="TableBlock">
                <tr style="height:50px">
                    <td style="width:146px;" align="center">分享给：</td>
                    <td>
                        <textarea class="BigStatic">@ViewBag.SharesName</textarea>
                    </td>
                </tr>
                <tr>
                    <td align="center">图片预览：</td>
                    <td><img style="margin:4px;" name="ImagePath" src="@Html.DisplayFor(model => model.ImagePath)" /></td>
                </tr>
                <tr>
                    <td align="center">附件文档：</td>
                    <td>@Html.EditorFor(model => model.Appendix)</td>
                </tr>
                <tr>
                    <td align="center">附件上传：</td>
                    <td>
                        <a class="addfile" href="javascript:;">
                            添加附件
                            <input class="addfile" type="file" size="1" style="display:none">
                        </a>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <div style="margin-left:4px;font-size:12px">照片描述：</div>
                        <div id="editor" style="width:1120px;height:500px;"></div>
                    </td>
                </tr>
                <tr align="center">
                    <td nowrap="" colspan="2" class="TableControl">
                        <input class="BigButton" type="submit" value="保存" />
                        <input style="margin-left:30px;" class="BigButton" type="button" value="关闭" onclick="window.close()" />
                    </td>
                </tr>
            </table>
        }
    </div>
</body>
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');
    ue.ready(function () {
        //设置编辑器的内容
        //这边有个问题就是 的scription含有双引号，外面又是双引号，会产生问题。。。所以要注意
        ue.execCommand('insertHtml', '@Html.Raw(Model.Description)');
        //测试：<p><img src="http://img.baidu.com/hi/jx2/j_0001.gif"/></p>
    });
</script>